import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class NestedScrollViewDemo2 extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      child: NestedScrollView(
        headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
          return <Widget>[SliverAppBar(
            expandedHeight: 230,
            pinned: true,
            flexibleSpace: FlexibleSpaceBar(
              title: Text('老孟',style: TextStyle(color: Colors.white),),
              background: Image.network('http://img.haote.com/upload/20180918/2018091815372344164.jpg',
                fit: BoxFit.fitHeight,),
            ),
           
          )];
        },
        body: ListView.builder(itemBuilder: (BuildContext context,int index){
          return Container(
            height: 80,
            color: Colors.primaries[index % Colors.primaries.length],
            alignment: Alignment.center,
            child: Text(
              '$index',
              style: TextStyle(color: Colors.white, fontSize: 20,decoration: TextDecoration.none),
            ),
          );
        },itemCount: 20,),
      ),
    );
  }
}
